package org.yang.novel.wx.controller;

import org.yang.common.Msg;
import org.yang.novel.wx.entity.Info;
import org.yang.novel.wx.service.InfoService;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;

import javax.annotation.Resource;
/**
 * 小说详情控制器
 * @author shichenyang
 * @email gyv12345@163.com
 * @date 2019/01/07
 */
@RestController
@RequestMapping("/info")
public class InfoController {
    @Resource
    private InfoService infoService;

    @GetMapping("/getInfos")
    public PageInfo getInfos(Info info,Integer page,Integer limit){
        return infoService.getInfos(info,page,limit);
    }
    @PostMapping("/addInfo")
    public Msg addInfo(Info info){
        return infoService.addInfo(info);
    }

    @PutMapping("/updateInfo")
    public Msg updateInfo(Info info){
        return infoService.updateInfo(info);
    }

    @DeleteMapping("/delInfo")
    public Msg delInfo(Info info){
        return infoService.delInfo(info);
    }
}
